package com.shop.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;


@Entity
@Table(name = "product")
public class Product {

	private int id;   //id
	private String name; //姓名
	private String description;//描述
	private String listimg; //图片集合
	private int price; //价格
	
	@Id
	@GenericGenerator(name = "generator", strategy = "increment") // 设置主键自增
	@GeneratedValue(generator = "generator")
	
	@Column(name = "id")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name = "description")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "listimg")
	public String getListimg() {
		return listimg;
	}

	public void setListimg(String listimg) {
		this.listimg = listimg;
	}
	
	
	@Column(name = "price")
	public int getPrice() {
		return price;
	}

	public void setPrice(int price) {
		this.price = price;
	}
	
	public Product() {

	}

	
	

	
	
	public Product(int id, String name, String description, String listimg, int price) {
		super();
		this.id = id;
		this.name = name;
		this.description = description;
		this.listimg = listimg;
		this.price = price;
	}

	@Override
	public String toString() {
		return "Product [id=" + id + ", name=" + name + ", description=" + description + ", listimg=" + listimg
				+ ", price=" + price + "]";
	}

	

	

}
